<template>
  <!--历史病历列表 -->
  <div>
    <a-collapse>
      <!-- v-for="(list, listIndex) in dataSource" :key="listIndex" -->
      <a-collapse-panel>
        <template #header>
          <div class="flex mb-1">
            <LabelValue :width="138" value="2025-01-10 10:10:10" />
            <LabelValue :width="80" value="门诊" />
          </div>
          <div class="flex">诊断： <LabelValue class="mb-1" :value="list?.bcLczdZdmc" /></div>
        </template>
        <div>
          <LabelValue class="mb-3" label="医技分类" width="200" tooltip value="心电图检查" />
          <div class="flex">
            <LabelValue class="mb-3" label="申请医生" width="200" tooltip value="陈亚冰" />
            <LabelValue class="mb-3" width="120" tooltip value="综合内科" />
          </div>
          <LabelValue class="mb-3" label="检查部位" width="200" tooltip value="胸部正位片" />
          <div class="flex justify-between">
            <a-button type="link" size="small"> 查阅报告 </a-button>
            <a-button type="link" size="small"> 查阅影像 </a-button>
          </div>
        </div>
      </a-collapse-panel>
    </a-collapse>
    <!-- <a-empty v-else /> -->
  </div>
</template>
<script setup>
import { ref, watch } from 'vue'
// import { message } from 'ant-design-vue'
import LabelValue from '@/components/LabelValue'
import { post } from '@/utils/request'
import useStore from '../../store'

const props = defineProps({
  activeKey: {
    type: String,
    default: ''
  }
})
// const emit = defineEmits(['success'])
const store = useStore()
const dataSource = ref([])

const queryList = async () => {
  const res = await post('/outp/mzys/getPatientEMRInfo', {
    brId: store.currentPatient.brId
  })
  dataSource.value = res.data || []
}

watch(
  () => props.activeKey,
  () => {
    store.currentPatient.brId && props.activeKey === '2' && queryList()
  },
  {
    deep: true,
    immediate: true
  }
)
watch(
  () => store.currentPatient.brId,
  () => {
    store.currentPatient.brId && props.activeKey === '2' && queryList()
  }
)
</script>

<style lang="less" scoped>
.doctor-advice {
  :deep(.ant-collapse-header) {
    padding: 0;
  }
  .advice-son {
    color: #525252;
    font-size: 13px;
  }
}
.son-doctor-advice {
  height: 12px;
  color: var(--primary-color);
  font-size: 14px;
}
:deep(.ant-divider-dashed::before) {
  border-color: #ccc;
  border-width: 1px;
}
:deep(.ant-divider-dashed::after) {
  border-color: #ccc;
  border-width: 1px;
}
</style>
